package com.etc.service.lmpl;

import com.etc.dao.UserMapper;
import com.etc.pojo.user.User;
import com.etc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/***
 * 业务层
 */
@Service                        //实现
public  class UserServicelmpl implements UserService {

    @Autowired
//    注入dao
    private UserMapper userMapper;
//    查询
    @Override
    public List<User> findByAll() {
        return userMapper.findByAll();
    }
//添加
    @Override
    public Integer save(User user){

        Integer save = userMapper.save(user);

        return save;
    }
// 删除
    @Override
    public Integer deleteById(Integer Id) {
        return userMapper.deleteById(Id);
    }
// 修改
    @Override
    public Integer updateByuser(User user) {
        return userMapper.updateUser(user);


    }
//查询
    @Override
    public User findById(int id) {
        return userMapper.findById(id);
    }


}







